<?php
class detail_model extends CI_Model
{
    protected $_table = "mock_products";
    protected $_tablecomment = "mock_comments";
    public function __construct()
    {
        parent::__construct();

    }
    public function getProduct($id)
    {
        $this->db->where("product_id",$id);
        return $this->db->get($this->_table)->row_array();
    }
    public function list_comment($id)
    {
        $this->db->where("product_id",$id);
        return $this->db->get($this->_tablecomment)->result_array();
    }
    public function addComment($data){
        $this->db->insert($this->_tablecomment,$data);
    }
}